package com.yang.search.utils;

import com.yang.common.model.StandardReport;

import java.time.LocalDateTime;

public class SearchUtils {

    /**
     * 索引前缀
     */
    public static final String INDEX = "sms_submit_log_";

    private static ThreadLocal<StandardReport> reportThread = new ThreadLocal<StandardReport>();

    public static void set(StandardReport report){
        reportThread.set(report);
    }

    public static StandardReport get(){
       return reportThread.get();
    }

    public static void remove(){
        reportThread.remove();
    }

    /**
     * 获取当前年份
     * @return
     */
    public static String getYear(){
        return LocalDateTime.now().getYear() + "";
    }
}
